import { Component } from "react";
import propTypes from "prop-types";

class Alert extends Component {
    static propTypes = {
        name: propTypes.string.isRequired,
        age: propTypes.number.isRequired,
        address: propTypes.string.isRequired,
    };
    static defaultProps = {
        name: "cowen",
        age: 18,
        address: "上海市浦东新区海曲路58号1号楼",
    };
    constructor(props) {
        super(props);
    }
    render() {
        const { name, age, address } = this.props;
        return (
            <div className='alert alert-danger'>
                姓名：{name}，年龄：{age}，地址：{address}
            </div>
        );
    }
}

export default Alert;
